//
//  PunchRecordCell.m
//  云律司
//
//  Created by 韦淋 on 2017/7/31.
//  Copyright © 2017年 test. All rights reserved.
//

#import "PunchRecordCell.h"

@implementation PunchRecordCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initalizeInterface];
    }
    return self;
}
- (void)initalizeInterface{
    [self.contentView addSubview:self.bgView];
    [self.bgView addSubview:self.timeLable];
    [self.bgView addSubview:self.punchLXLable];
    [self.bgView addSubview:self.punchTypeLable];
    [self.bgView addSubview:self.punchFLLable];
}
- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.bgView.frame = CGRectMake(5, 0, self.contentView.bounds.size.width - 10, self.contentView.bounds.size.height - 15);
    self.timeLable.frame = CGRectMake(7, 7, 100, 50);
    self.punchLXLable.frame = CGRectMake(107, 7, 50, 50);
    self.punchTypeLable.frame = CGRectMake(157, 7, 100, 50);
    self.punchFLLable.frame = CGRectMake(257, 7, 100, 50);
    
}

- (UIView *)bgView{
    if (!_bgView) {
        _bgView = [[UIView alloc] init];
        _bgView.backgroundColor = [UIColor colorWithRed:33.0f/255.0f green:180.0f/255.0f blue:237.0f/255.0f alpha:1.0f];
        _bgView.layer.masksToBounds = YES;
        _bgView.layer.cornerRadius = 5;
    }
    return _bgView;
}

- (UILabel *)timeLable{
    if (!_timeLable) {
        _timeLable = [[UILabel alloc]init];
        _timeLable.textColor = [UIColor whiteColor];
        _timeLable.font = [UIFont systemFontOfSize:13];
        _timeLable.numberOfLines = 2;
        _timeLable.lineBreakMode = NSLineBreakByTruncatingTail;
        _timeLable.textAlignment = NSTextAlignmentCenter;
    }
    return _timeLable;
}
- (UILabel *)punchLXLable{
    if (!_punchLXLable) {
        _punchLXLable = [[UILabel alloc]init];
        _punchLXLable.textColor = [UIColor whiteColor];
        _punchLXLable.font = [UIFont systemFontOfSize:13];
        _punchLXLable.textAlignment = NSTextAlignmentCenter;
    }
    return _punchLXLable;
}
- (UILabel *)punchTypeLable{
    if (!_punchTypeLable) {
        _punchTypeLable = [[UILabel alloc]init];
        _punchTypeLable.textColor = [UIColor whiteColor];
        _punchTypeLable.font = [UIFont systemFontOfSize:13];
        _punchTypeLable.textAlignment = NSTextAlignmentCenter;
    }
    return _punchTypeLable;
}

- (UILabel *)punchFLLable{
    if (!_punchFLLable) {
        _punchFLLable = [[UILabel alloc]init];
        _punchFLLable.textColor = [UIColor whiteColor];
        _punchFLLable.font = [UIFont systemFontOfSize:13];
        _punchFLLable.textAlignment = NSTextAlignmentCenter;
    }
    return _punchFLLable;
}


@end
